package com.tz.util;

import org.hibernate.Session;

/**
 * 线程变量工具类
 * 可以定义在线程存放的数据类型
 */
public class MyThreadLocal {

    //变量的存取 by thread
    private static ThreadLocal<Session> threadLocal = new ThreadLocal<>();

    public static Session get(){
        return threadLocal.get();
    }

    public static void set(Session session){
        threadLocal.set(session);
    }

}
